package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrderDetailMapper {
    /*
    * 批量插入订单明细数据 , (这里会循环插入)
    * */

    void insertBatch(List<OrderDetail> orderDetailList);

    @Select("select * from order_detail where id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);

    /*
    * 查询订单明细表中指定时间内的销量前十商品，按照从高到低进行排序
    * */


    List<String> getTop10Name(LocalDateTime localBeginTime, LocalDateTime localEndTime);
}
